Skip to content

feature(branch_archive): move history worth keeping into the Gut, from anywhere - #283

Merged
Jammy2211 merged 1 commit into
mainfrom
claude/repo-cleanup-82k6kh
Aug 25, 2026
Merged

feature(branch_archive): move history worth keeping into the Gut, from anywhere#283
Jammy2211 merged 1 commit into
mainfrom
claude/repo-cleanup-82k6kh

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

What the audit found

PyAutoHands carries a master alongside main. It is not a stale trunk from a rename:

main   root  cf12459  2023-06-05  "history reset"
master root  7d8743a  2021-02-12  "Add workflow to run integration test"
master tip   55da101  2022-11-27  442 commits

merge-base(main, master) → exit 1, no output      # no common ancestor
git tag --contains 55da101 → (0 tags in the repo)  # nothing else pins it

main was started fresh in June 2023. master is the repo's original history, orphaned by that reset and the only copy of it. Deleting it makes 442 commits unreachable; leaving it is clutter. It is also the only master across all 25 sweepable repos — a one-off, not a pattern.

The Gut exists precisely for this, but pyauto-gut is a CLI and PyAutoGut ships no workflow, so the operation was laptop-only — the same gap this session closed for the sweep.

Deliberately not a mode of the sweep

The sweep's question is "is this already in main?". This workflow's is "is this safely in the Gut yet?". Sharing a code path would put an irreversible delete behind the wrong predicate.

The ordering is the substance

archive  →  VERIFY on the Gut  →  delete

The verification is a fresh ls-remote against the Gut that also checks the landed SHA equals the branch's — not a reading of the push's own exit code. A push that reports success but lands nothing, or lands under a different name, would otherwise be followed by an irreversible delete. Any mismatch aborts with the source branch untouched.

The archive delegates to pyauto-gut archive rather than reimplementing the push, so the Gut keeps ownership of its namespace and its refusal-to-overwrite. Brain drives, Gut holds — the Heart/vitals template.

Other guards

  • Target must be a sweepable repo, by the same body-map boundary the sweep uses.
  • Archive name must be a plain slug, so it cannot climb out of archive/condemned/.
  • A repo's default branch is refused, whatever it is called.

Not included, on purpose

Filing the condemned.md entry. That is Mind state and a judgement: original project history should be held undated — no sweep-after — so no later sweep ever voids it. A workflow should not be deciding that.

Checks

pytest tests/510 passed · check_skill_line_counts.sh → OK · repos_sync.py --checkall 12 green.

Slug guard exercised directly: ../escape, .hidden, empty and has space rejected; pyautohands-pre-2023-history and ok_name.1 accepted.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KwqicJpMqmcT5RVbyNwdKq


Generated by Claude Code

…m anywhere

The org-wide audit found a branch the sweep must never delete and must not
leave lying around either: a `master` carrying 442 commits from 2021-2022,
orphaned by a later "history reset", sharing NO common ancestor with main and
pinned by no tag. It is the only copy of that history. Deleting it is loss;
keeping it is clutter. The Gut exists for exactly this, but `pyauto-gut` is a
CLI and PyAutoGut ships no workflow, so the operation was laptop-only — the
same gap this session closed for the sweep.

This is deliberately NOT a mode of branch_sweep_all.yml. The sweep's question
is "is this already in main?"; this workflow's is "is this safely in the Gut
yet?". Sharing a code path would put an irreversible delete behind the wrong
predicate.

The ordering is the substance, not the plumbing:

  archive  →  VERIFY on the Gut  →  delete

The verification is a fresh `ls-remote` against the Gut that also checks the
landed SHA equals the branch's, not a reading of the push's exit code. A push
that reports success but lands nothing — or lands under a different name —
would otherwise be followed by an irreversible delete. Any mismatch aborts
with the source branch untouched.

The archive itself delegates to `pyauto-gut archive` rather than reimplementing
the push, so the Gut keeps ownership of its own namespace and its own
refusal-to-overwrite. Brain drives, Gut holds — the Heart/vitals template.

Also guarded: the target must be a sweepable repo by the same body-map
boundary the sweep uses; the archive name must be a plain slug so it cannot
climb out of the namespace; and a repo's default branch is refused whatever it
is called.

Filing the condemned.md entry is left out on purpose. That is Mind state and a
judgement — original project history should be held *undated*, so no later
sweep ever voids it, and a workflow should not be deciding that.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KwqicJpMqmcT5RVbyNwdKq
@Jammy2211
Jammy2211 merged commit 24a1467 into main Aug 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants